# !/usr/bin/env python
# -*-coding:utf-8 -*-

"""
# Author     ：skyTree
# version    ：python 3.11
# Description：所有子路由的出口
"""
from fastapi import APIRouter, Security

from core.Auth import check_permissions
from .user import user_router
from .role import role_router
from .auth import auth_router
from .category import category_router
from .attr import attr_router
from .good import good_router
from .menu import menu_router

api_router = APIRouter()
api_router.include_router(auth_router, prefix="/api")
api_router.include_router(user_router, prefix="/api", tags=["用户管理"],
                          dependencies=[Security(check_permissions, scopes=['user_list_scopes'])])
api_router.include_router(role_router, prefix="/api", tags=["角色管理"], dependencies=[Security(check_permissions)])
api_router.include_router(category_router, prefix="/api", tags=["商品分类管理"],
                          dependencies=[Security(check_permissions)])

api_router.include_router(attr_router, prefix="/api", tags=["商品属性管理"],
                          dependencies=[Security(check_permissions)])

api_router.include_router(good_router, prefix="/api", tags=['商品管理'], dependencies=[Security(check_permissions)])
api_router.include_router(menu_router, prefix="/api", tags=['菜单管理'], dependencies=[Security(check_permissions)])
